{% load i18n wagtailroutablepage_tags %}

<div class="card my-4">
<h5 class="card-header">Categories</h5>
<div class="card-body">
  <div class="row">
    <div class="col-lg-12">
      <ul class="list-unstyled mb-0">

        {% for category in categories %}
            <li>
                <a href="{% routablepageurl blog_page "post_by_category" category.slug %}">
                    {{ category.name }}
                </a>
            </li>
        {% empty %}
            {% trans 'No categories yet' %}
        {% endfor %}

      </ul>
    </div>
  </div>
</div>
</div>